<?php
/**
 * Author: xin
 * Email: niuxinxin0909@163.com
 * Created at: 2020-12-05 13:00
 */

/**
 * @var $this yii\web\View
 * @var $dataProvider \yii\data\ActiveDataProvider
 * @var $searchModel \backend\models\search\OptionsSearch
 */

use backend\grid\DateColumn;
use backend\grid\GridView;
use backend\widgets\Bar;
use backend\grid\CheckboxColumn;
use backend\grid\ActionColumn;

$this->title = '品牌管理';
?>
<div class="row">
    <div class="col-sm-12">
        <div class="ibox">
            <?= $this->render('/widgets/_ibox-title') ?>
            <div class="ibox-content">
                <?= Bar::widget()?>
                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'filterModel' => $searchModel,
                    'columns' => [
                        [
                            'class' => CheckboxColumn::className(),
                        ],
                        [
                            'attribute' => 'brand_name',
                            'label' => Yii::t('app', 'Brand Name'),
                        ],
                        [
                            'attribute' => 'brand_log',
                            'format' => 'raw',
                            'value' => function($model){
                                        return "<img class='img-responsive' src='{$model->brand_logo}'>";
                                },
                            'label' => Yii::t('app', 'Brand Log')
                        ],
                        [
                          'attribute' => 'brand_msg',
                          'label' => Yii::t('app', 'Brand Msg')
                        ],
                        [
                            'attribute' => 'brand_manager',
                            'label' => Yii::t('app', 'Brand Manager')
                        ],
                        [
                            'attribute' => 'brand_account',
                            'label' => Yii::t('app', 'Brand Account')
                        ],
                        [
                            'class' => DateColumn::className(),
                            'attribute' => 'created_at',
                            'filter' => false,
                            'label' => Yii::t('app', 'Created At'),
                        ],
                        [
                            'class' => DateColumn::className(),
                            'attribute' => 'updated_at',
                            'label' => Yii::t('app', 'Updated At'),
                            'filter' => false,
                        ],
                        [
                            'class' => ActionColumn::className(),
                            'width' => '190px'
                        ],
                    ]
                ]); ?>
            </div>
        </div>
    </div>
</div>